package com.he1618.boot3.listener;


import com.he1618.boot3.event.TodoFinishEvent;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableAsync
public class CommonListener {


    //DesignOrderDistributionResponse

    //@Scheduled(fixedDelay = 5000)
    @Async
    @EventListener(TodoFinishEvent.class)
    public void notifyDistribution(TodoFinishEvent event) {
        try {
            Thread.sleep(5000L);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        //this.wait(5000);
        System.out.println("这是一个测试");
    }


}
